<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0041)./Manage.html -->
<html xmlns="http//www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <title>榆林科技馆内容页</title>
    <link rel="stylesheet" type="text/css" href="../css/reset.css">
    <link rel="stylesheet" type="text/css" href="../css/main.css">
    <script type="text/javascript" src="./js/adddate.js.下载"></script>
    <script type="text/javascript" src="../js/vue2.min.js"></script>
    <script type="text/javascript" src="../js/axios.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function (e) {
        $(".select1").uedSelect({
            width: 345
        });
        $(".select2").uedSelect({
            width: 167
        });
        $(".select3").uedSelect({
            width: 100
        });
    });
    function checkAll(chkAllID, thisObj) {
        var chkAll = document.getElementById(chkAllID);
        var chks = document.getElementsByTagName("input");
        var chkNo = 0;
        var selectNo = 0;
        for (var i = 0; i < chks.length; i++) {
            if (chks[i].type == "checkbox") {
                //全选触发事件
                if (chkAll == thisObj) {
                    chks[i].checked = thisObj.checked;
                }
                //非全选触发
                else {
                    if (chks[i].checked && chks[i].id != chkAllID)
                        selectNo++;
                }
                if (chks[i].id != chkAllID) {
                    chkNo++;
                }
            }
        }
        if (chkAll != thisObj) {
            chkAll.checked = chkNo == selectNo;
        }
    }
</script></head>

<body>
    <!--条件检索-->
<!--    <form name="form" method="post" action="./Manage.html" id="form">-->


<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form'];
if (!theForm) {
    theForm = document.form;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>



    <div class="main_box">
        <div class="side_here">
            <p>
                <a href="./Manage.html#" title="首页"></a>当前位置 &gt; <span>科技馆场次管理</span> &gt; <span>场次信息管理</span></p>
        </div>
        <div class="kong">
        </div>
        <!--公用位置导航结束-->
        <div id="app">
        <div class="cont_box">
            <p class="title_bt">
                条件查询</p>
            <table class="table_list1" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                    <tr>
                        <td class="name">
                            开馆日期：
                        </td>
                        <td class="enter3">
                            <input name="TextBox2" v-model="condition.openDate" type="text" id="TextBox2" class="timeimg" placeholder="时间不能留空" onclick="SelectDate(this,&#39;yyyy-MM-dd&#39;)">
                        </td>
                        <td class="name">
                            审核状态：
                        </td>
                        <td class="enter3">
                            <select name="DropDownList1" id="DropDownList1"  v-model="condition.status" class="enter_k" placeholder="请选择">
	<option value="2">--请选择--</option>
	<option value="0">已审核</option>
	<option value="1">未审核</option>

</select>
                        </td>
                        <td>
                            <input type="button" name="Button1" @click="search()" value="查询" id="Button1" class="chaxun">
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <!--表格选项-->
        <div class="cont_box" >
            <p class="title_bt">
                场次列表</p>

            <table width="1060" border="0" cellpadding="0" cellspacing="0" class="table_list2">
                <tbody>
                <tr>
                    <th width="6%">
                        全选&nbsp;<input class="qx_btn" type="checkbox" id="chkAll" name="chkAll" value="checkbox" onclick="checkAll   (&#39;chkAll&#39;,this);">
                    </th>
                    <th width="15%">
                        开馆日期
                    </th>
                    <th width="6%">
                        容纳人数
                    </th>
                    <th width="6%">
                        预约人数
                    </th>
                    <th width="15%">
                        开馆时间
                    </th>
                    <th width="15%">
                        闭馆时间
                    </th>
                    <th width="18%">
                        预约状态
                    </th>
                    <th width="15%">
                        操作
                    </th>
                </tr>
                <tr v-for="c in ChangCi">
                    <td>
                        <input name="Repeater1$ctl00$chec" type="checkbox" id="Repeater1_ctl00_chec" onclick="checkAll(&#39;chkAll&#39;,this);" text="800">

                    </td>
                    <td>
                        {{c.openDate}}
                    </td>
                    <td>
                        {{c.maxNumber}}
                    </td>
                    <td>
                        {{c.maxOrderNumber}}
                    </td>
                    <td>
                        {{c.startTime}}
                    </td>
                    <td>
                        {{c.endTime}}
                    </td>
                    <td>
                        {{c.status}}
                    </td>

                    <td>
                        <input type="button" @click="goEdit(c.cgID)" name="Repeater1$ctl00$Button2" value="" id="Repeater1_ctl00_Button2" class="btn_an btn_config" title="编辑">&nbsp;
                        <input type="button" @click="del(c.cgID)" name="Repeater1$ctl00$btndel" value="" id="Repeater1_ctl00_btndel" class="btn btn_an btn_del" title="删除">
                        &nbsp;<input type="button" @click="audit(c.cgID)" name="Repeater1$ctl00$Button12" value="" id="Repeater1_ctl00_Button12" class="btn btn_an btn_checked" title="审核">
                    </td>
                </tr>
                </tbody></table>
            <input type="submit" name="pi" value="批量审核" @click="piliang()" id="pi" class="chaxun" style="width:94px;margin-left: 500px; margin-top: 30px;">
            <!--页码开始-->
            <div class="pages" style="margin-top: 40px;">
                <ul class="yema">
                    <li style="border-left: none;">
                        <a id="Lbthead" class="pagebtn" href="javascript:__doPostBack(&#39;Lbthead&#39;,&#39;&#39;)">首页</a></li>
                    <li>
                        <a id="Lbtpre" class="pagebtn" href="javascript:__doPostBack(&#39;Lbtpre&#39;,&#39;&#39;)">上一页</a></li>
                    <li>
                        <a id="Lbtnext" class="pagebtn" href="javascript:__doPostBack(&#39;Lbtnext&#39;,&#39;&#39;)">下一页</a></li>
                    <li>
                        <a id="Lbtend" class="pagebtn" href="javascript:__doPostBack(&#39;Lbtend&#39;,&#39;&#39;)">尾页</a></li>
                    <div class="clear">
                    </div>
                </ul>
                <div class="searchPage">
                    <span class="page-sum">共<strong class="allPage">&nbsp;76
                    </strong>页</span><span class="page-sum">第<strong class="allPage">&nbsp;1
                    </strong>页</span> <span class="page-go">跳转第
                        <input name="Txtpageno" type="text" id="Txtpageno" class="pagebtn" size="3" onkeyup="this.value=this.value.replace(/[^\d\.]/g, &#39;&#39;)" style="ime-mode: disabled">页</span>
                    <a id="BtngoPage" class="page-btn" href="javascript:__doPostBack(&#39;BtngoPage&#39;,&#39;&#39;)">GO</a>
                </div>
            </div>


            </div>
        </div>
    </div>
   
  
    <!--页码结束-->
    <!--按钮元素-->
    </form>



</body>
<script type="text/javascript">
    var v=new Vue({
        el:'#app',
        data:{
            condition:{//此对象与查询条件绑定
                'openDate':'2022-08-15',
                'status':2
            },
            ChangCi:[ {"cgID":1,"openDate":"2022-08-16","maxNumber":100,"maxOrderNumber":100,"startTime":"09:00:00","endTime":"20:00:00","status":"未审核"}
            ]},
        methods:{
            goEdit:function(id){
                alert(id);
                window.location.href="Update.html?id="+id;
            },
            del:function(id){
                alert(id);
                if(window.confirm("really?")){
                    var url="/cg?action=delete&id="+id;
                    axios.get(url).then(res=>{
                        if(res.data=="success"){
                            for(var i=0;i<v.ChangCi.length;i++){
                                if(v.ChangCi[i].cgID==id){
                                    v.ChangCi.splice(i,1);
                                }
                            }
                        }
                        }
                    );
                }
            },
            audit:function (id){
                // alert(id);
                    var url="/cg?action=audit&id="+id;
                    axios.get(url).then(res=>{
                        if(res.data=="success") {
                            if (window.confirm("really")) {
                                for (var i = 0; i < v.ChangCi.length; i++) {
                                    if (v.ChangCi[i].cgID == id) {
                                        v.ChangCi[i].status = "已审核";
                                    }
                                }
                            }
                        }else{
                            window.confirm("已审核过");
                        }
                    });
                }
            },
            search:function(){
                alert("发起查询"+v.condition.openDate+" "+v.condition.status);
                var url = "/cg?action=search&openDate="+v.condition.openDate+"&status="+v.condition.status;
                axios.get(url)
                    .then(res=>{
                        v.ChangCi = res.data;
                    });
            },
        piliang:function (){
            var chek = document.getElementsByName("Repeater1$ctl00$chec");
            var cgIDs = [];
            for (var i=0;i<chek.length;i++){
                if (chek[i].checked){
                    cgIDs.push(chek[i].value);
                }
            }
            var url ="../cg?action=plshenHe&cgIDs="+cgIDs;
            alert(url);
            axios.get(url)
                .then(res=>{
                    if (res.data=="success"){
                        for (var i=0;i<cgIDs.length;i++){
                            for (var j=0;j<tab.cc.length;j++){
                                if (v.ChangCi[j].cgID==cgIDs[i]){
                                    v.ChangCi[j].status='已审核';
                                }
                            }
                        }
                    }
                });

        }



    });
    window.onload = init;
    function init(){
        axios.get("/cg?action=findAll").then(res=>{
            console.log(res);
            v.ChangCi=res.data;
        });
    }
</script></html>